<?php
namespace App\Http\Controllers\Property;

use App\Common\json;
use App\Http\Controllers\Controller;
use App\Libraries\upload;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class AddController extends Controller{

    public function addlook(Request $request){
        if($request ->isMethod('post')){
            $user_id   = $request ->input('user_id');
            $sugges_image  = $request ->input('sugges_image');
            $sugges_content  = $request ->input('sugges_content');
            $sugges_name     = $request ->input('sugges_name');
            $data            = DB::table('sugges') ->insert(['sugges_user'=>$user_id,'sugges_image'=>$sugges_image,'sugges_content'=>$sugges_content
            ,'sugges_name'=>$sugges_name,'sugges_create_time'=>date('Y-m-d H:i:s')]);
           $arr  = (object)array();
            if($data == true){
                return json::json('success', '添加成功', $arr);
            }else{
                return json::json('failure','由于网络或者不正当原因失败',$arr);
            }

        }
    }
}